//
//  MyLabel.m
//  UI02_UILable_UITextFile_UIButton_UIImageView
//
//  Created by LGC on 16/3/10.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "MyLabel.h"

@implementation MyLabel

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame text:(NSString *)text {
    self = [super initWithFrame:frame];
    if (self) {
        self.text = text;
        [self config];
    }
    return self;
}

- (void)config {
    
    // 右对齐
    self.textAlignment = NSTextAlignmentRight;
    
    // 字体颜色
    self.textColor = [UIColor redColor];
    
    // 字体(Font)
    self.font = [UIFont systemFontOfSize:22];
    
    self.font = [UIFont boldSystemFontOfSize:25];
    
    // 行数 (0表示没有行数限制)
    self.numberOfLines = 0;
    
    // 断行模式
    self.lineBreakMode = NSLineBreakByWordWrapping;
    
    // 文本阴影颜色
    self.shadowColor = [UIColor grayColor];
    
    // 文本偏移量
    self.shadowOffset = CGSizeMake(2, 2);
    
}

@end
